#define _CRT_SECURE_NO_WARNINGS 1
#include "game.h"

void game()
{
	char mine[ROWS][COLS] = { 0 };
	char show[ROWS][COLS] = { 0 };

	//初始化棋盘
	LnitMineShow(mine,ROWS,COLS,'0');
	LnitMineShow(show,ROWS,COLS,'*');

	//PrintMineShow(mine,ROWS,COLS);
	//PrintMineShow(show, ROWS, COLS);

	//布置雷
	SetTnt(mine,ROW,COL);

	//打印棋盘
	//PrintMineShow(mine,ROW,COL);
	PrintMineShow(show,ROW,COL);

	//排查雷
	InvestTnt(mine,show,ROW,COL);
}

void menu()
{
	printf("****************\n");
	printf("*****1.play*****\n");
	printf("*****0.exit*****\n");
	printf("****************\n");
}

void test()
{
	int n = 0;
	srand((unsigned int)time(NULL));
	do
	{
		menu();
		printf("请选择->:");
		scanf("%d", &n);
		switch (n)
		{
			case 1:
				game();
				break;
			case 0:
				printf("游戏结束，退出游戏！！！\n");
				break;
			default:
				printf("非法选择，请重新选择！！！\n");
				break;
		}
	} while (n);
}

int main()
{
	test();
	return 0;
}